package com.springboot.wisdom.log.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.springboot.wisdom.common.common.bean.MyResult;
import com.springboot.wisdom.common.common.bean.PageQueryDTO;
import com.springboot.wisdom.log.domain.vo.LogVO;
import com.springboot.wisdom.log.service.LogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "日志模块")
@ApiSupport(author = "LY L")
@RestController
@RequestMapping(value = "/log", produces = {"application/json;charset=UTF-8"})
@Slf4j
@Validated     // springboot 2.5.* 版本需要在类上标注 @Validated 注解校验注解才会生效。
public class LogController {

    @Resource
    private LogService logService;

    @ApiOperation(value = "日志列表分页", notes = "只能查看自己账号的日志。")
    @GetMapping("/logInfo/page")
    public MyResult<Page<LogVO>> getInfoPageBy(PageQueryDTO pageQueryDTO, LogVO logVO) {
        return logService.getInfoPageBy(pageQueryDTO, logVO);
    }

    // 导出日志。
}
